<template>
  <div>
    <div class="swiper">
      <van-swipe class="my-swipe" :autoplay="3000" :show-indicators="false">
        <van-swipe-item @click="swiper(item)" v-for="(item,index) in list" :key="index">
          <img class="banner_image" :src="item.banner_img" alt />
        </van-swipe-item>
      </van-swipe>
    </div>
  </div>
</template>

<script>
import { Swipe, SwipeItem } from "vant";

import { banner,cartlist } from "../request/http";
export default {
  components: {
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem
  },
  mounted() {
    document.body.style.background = "#f2f3f5";
    this.getBaner();
    cartlist().then(res=>{
        console.log(res)
        this.cartlist = res
    })
  },
  data() {
    return {
      list: [],
      cartlist:[]
    };
  },
  methods: {
    getBaner() {
      banner().then(res => {
        console.log(res)
        this.list = res;
      });
    },
   
  }
};
</script>


<style lang="scss" scoped>
.bottom {
  height: 60px;
}
.swiper {
  overflow: hidden;
  width: 100%;
  height: 0;
  padding-bottom: 51%;
}
.banner_image {
  width: 100%;
}
</style>